home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- import new
-
- def SetMinHeight(self, h):
- self.minHeight = h
- if h != -1 and self.GetSize().height < h:
- self.SetSize((-1, h))
-
-
-
- def GetMinHeight(self):
- return self.minHeight
-
- import wx.lib.expando as wx
- wx.lib.expando.ExpandoTextCtrl.SetMinHeight = SetMinHeight
- wx.lib.expando.ExpandoTextCtrl.GetMinHeight = GetMinHeight
-
- wx.lib.expando.ExpandoTextCtrl.GetExtraHeight = lambda self: self.extraHeight
- del SetMinHeight
- del GetMinHeight
- import cgui
- wx.Rect.Clamp = new.instancemethod(cgui.RectClamp, None, wx.Rect)
- wx.Rect.ClampPoint = new.instancemethod(cgui.RectClampPoint, None, wx.Rect)
-
- wx.ContextMenuEvent.IsKeyPress = lambda e: e.Position == (-1, -1)
-
- wx.Timer.StartRepeating = lambda self, ms: wx.Timer.Start(self, ms, False)
-
- wx.Timer.StartOneShot = lambda self, ms: wx.Timer.Start(self, ms, True)
-
- def CreateTransparentBitmap(w, h):
- bitmap = wx.EmptyBitmap(w, h)
- bitmap.UseAlpha()
- return bitmap
-
- wx.TransparentBitmap = CreateTransparentBitmap
-
- try:
- from cgui import SetBold
- except ImportError:
- import sys
- print >>sys.stderr, 'WARNING: using slow SetBold'
-
- def SetBold(win, bold = True):
- f = win.Font
- None(f.SetWeight if bold else wx.FONTWEIGHT_NORMAL)
- win.Font = f
-
-
- if getattr(wx, 'WXPY', False):
- wx.WindowClass = wx._Window
- else:
- wx.WindowClass = wx.Window
- wx.WindowClass.SetBold = new.instancemethod(SetBold, None, wx.WindowClass)
-
- def call_later_repr(self):
- funcinfo = funcinfo
- import util
- fi = funcinfo(self.callable)
- if self.running:
- return '<CallLater (running) %s>' % fi
- else:
- return '<CallLater %s>' % fi
-
- wx.CallLater.__repr__ = call_later_repr
- if not getattr(wx, 'WXPY', False):
-
- wx.Dialog.__enter__ = lambda self: self
-
- wx.Dialog.__exit__ = lambda self, type, value, traceback: self.Destroy()
-
- def IsDestroyed(win):
- return not bool(win)
-
- from cStringIO import StringIO
-
- def ImageFromString(s):
- return wx.ImageFromStream(StringIO(s))
-
- wx.ImageFromString = ImageFromString
- wx.AcceleratorTableFromSequence = wx.AcceleratorTable
- wx.IsDestroyed = IsDestroyed
- del IsDestroyed
-
- if not hasattr(wx.RendererNative, 'DrawFocusRect'):
-
- wx.RendererNative.DrawFocusRect = lambda *a, **k: pass
-
- import webview
- if not hasattr(webview.WebView, 'ResetTextSize'):
-
- webview.WebView.ResetTextSize = lambda *a, **k: pass
-
- if 'wxGTK' in wx.PlatformInfo:
- orig_bmpeq = wx.Bitmap.__eq__
-
- def bmpeq(self, other):
- if isinstance(other, wx.Bitmap):
- return orig_bmpeq(self, other)
-
- return False
-
- wx.Bitmap.__eq__ = bmpeq
-
-
- def RaiseExisting(cls):
- for tlw in wx.GetTopLevelWindows():
- if type(tlw) is cls:
- tlw.Raise()
- return tlw
- continue
-
-
- wx.TopLevelWindow.RaiseExisting = classmethod(RaiseExisting)
-
- try:
- from cgui import LeftDown
- except ImportError:
-
- def LeftDown():
- return wx.GetMouseState().LeftDown()
-
-
- wx.LeftDown = LeftDown
-